home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / librw / RWGQueue.z / RWGQueue
Encoding:
Text File  |  2002-10-03  |  7.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWGQueue(type) - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/gqueue.h>
  13.  
  14.  
  15.  
  16.               declare(RWGQueue, type)
  17.           RWGQueue(type) a ;
  18.  
  19.  
  20.  
  21.  
  22. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  23.      Class RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((ttttyyyyppppeeee)))) represents a group of ordered elements, not
  24.      accessible by an external key.  A RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((ttttyyyyppppeeee)))) is a first in, first out
  25.      (FIFO) sequential list for which insertions are made at one end (the
  26.      "tail"), but all removals are made at the other (the "head").  Hence, the
  27.      ordering is determined externally by the ordering of the insertions.
  28.      Duplicates are allowed. This class is implemented as a singly-linked
  29.      list.  Objects of type RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((ttttyyyyppppeeee)))) are declared with macros defined in
  30.      the standard C++ header file <<<<ggggeeeennnneeeerrrriiiicccc....hhhh>>>>.  In order to find a particular
  31.      item within the collection, a user-provided global "tester" function is
  32.      required to test for a "match", definable in any consistent way.  This
  33.      function should have prototype:
  34.  
  35.               RWBoolean yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(const ttttyyyyppppeeee* c, const void* d);
  36.  
  37.  
  38.  
  39.  
  40.  
  41.      The argument cccc is a candidate within the collection to be tested for a
  42.      match.  The argument dddd is for your convenience and will be passed to
  43.      yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(((())))....  The function should return TTTTRRRRUUUUEEEE if a "match" is
  44.      found between cccc and dddd.  In order to simplify the documentation below, an
  45.      imaginary typedef
  46.  
  47.               typedef RWBoolean (*yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr)(const ttttyyyyppppeeee*, const void*);
  48.  
  49.  
  50.  
  51.  
  52.  
  53.      has been used for this tester function.
  54.  
  55. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.      None
  75.  
  76. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  77.               RRRRWWWWGGGGQQQQuuuueeeeuuuueeee(ttttyyyyppppeeee)();
  78.  
  79.  
  80.      Construct an empty queue.
  81.  
  82.               RRRRWWWWGGGGQQQQuuuueeeeuuuueeee(ttttyyyyppppeeee)(ttttyyyyppppeeee* a);
  83.  
  84.  
  85.      Construct a queue with one entry aaaa.
  86.  
  87.               RRRRWWWWGGGGQQQQuuuueeeeuuuueeee(ttttyyyyppppeeee)(const RWGQueue(ttttyyyyppppeeee)& q);
  88.  
  89.  
  90.      Copy constructor.  A shallow copy of qqqq is made.
  91.  
  92. AAAAssssssssiiiiggggnnnnmmmmeeeennnntttt OOOOppppeeeerrrraaaattttoooorrrr
  93.               void
  94.           ooooppppeeeerrrraaaattttoooorrrr====(const RWGQueue(ttttyyyyppppeeee)& q);
  95.  
  96.  
  97.      Assignment operator.  A shallow copy of qqqq is made.
  98.  
  99. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  100.               ttttyyyyppppeeee*
  101.           aaaappppppppeeeennnndddd(ttttyyyyppppeeee* a);
  102.  
  103.  
  104.      Adds aaaa to the end of the queue and returns it.  Returns nnnniiiillll if the
  105.      insertion was unsuccessful.
  106.  
  107.               void
  108.           cccclllleeeeaaaarrrr();
  109.  
  110.  
  111.      Removes all items from the queue.
  112.  
  113.               RWBoolean
  114.           ccccoooonnnnttttaaaaiiiinnnnssss(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr tttt, const void* d) const;
  115.  
  116.  
  117.      Returns TTTTRRRRUUUUEEEE if the queue contains an item for which the user-defined
  118.      function pointed to by tttt finds a match with dddd.
  119.  
  120.               RWBoolean
  121.           ccccoooonnnnttttaaaaiiiinnnnssssRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
  122.  
  123.  
  124.      Returns TTTTRRRRUUUUEEEE if the queue contains an item with the address eeee.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.               size_t
  141.           eeeennnnttttrrrriiiieeeessss() const;
  142.  
  143.  
  144.      Returns the number of items in the queue.
  145.  
  146.               ttttyyyyppppeeee*
  147.           ffffiiiirrrrsssstttt() const;
  148.  
  149.  
  150.      Returns the first item in the queue, or nnnniiiillll if the queue is empty.
  151.  
  152.               ttttyyyyppppeeee*
  153.           ggggeeeetttt();
  154.  
  155.  
  156.      Returns and rrrreeeemmmmoooovvvveeeessss the first item in the queue.  Returns nnnniiiillll if the
  157.      queue is empty.
  158.  
  159.               RWBoolean
  160.           iiiissssEEEEmmmmppppttttyyyy() const;
  161.  
  162.  
  163.      Returns TTTTRRRRUUUUEEEE if the queue is empty, otherwise FFFFAAAALLLLSSSSEEEE.
  164.  
  165.               ttttyyyyppppeeee*
  166.           iiiinnnnsssseeeerrrrtttt(ttttyyyyppppeeee* a);
  167.  
  168.  
  169.      Calls aaaappppppppeeeennnndddd((((ttttyyyyppppeeee****)))) with aaaa as the argument.
  170.  
  171.               ttttyyyyppppeeee*
  172.           llllaaaasssstttt();
  173.  
  174.  
  175.      Returns the last (most recently inserted) item in the queue, or nnnniiiillll if
  176.      the queue is empty.
  177.  
  178.               size_t
  179.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d) const;
  180.  
  181.  
  182.      Returns the number of items in the queue for which the user-provided
  183.      function pointed to by tttt finds a match with dddd.
  184.  
  185.               size_t
  186.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffffRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
  187.  
  188.  
  189.      Returns the number of items in the queue with the address eeee....
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.